package demo1;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
public class Test03<E> {
    public void doSome(){
        System.out.println("hello");
    }
    public static void main(String[] args) {
//        List<String> list = new ArrayList<>();
//        list.add("nihao");
//        list.add("shijie");
//        for(String s: list)
//        {
//            System.out.println(s);
//        }
//        List<Animal> list = new LinkedList<>();
//        list.add(new Cat());
//        list.add(new Dog());
//        for(Animal animal: list){
//            animal.move();
//        }
        Person<String> person = new Person<>();
        person.doSome();
    }
}
class Animal{
    public void move(){
        System.out.println("动物在移动！");
    }
}
class Cat extends Animal{
    @Override
    public void move() {
        System.out.println("猫在移动！");
    }
}
class Dog extends Animal{
    @Override
    public void move() {
        System.out.println("狗在移动！");
    }
}
class Person<E>{
    public void doSome(){
        System.out.println("person的doSome方法");
    }
}